<?php 
namespace app\home\model;
use app\run\model\App;
use think\Model;
use think\Db;
class Subscribe extends Model{//属性表
	public static function selSubs($user){
		if(session('PHONE')!=''){
			$res = Db::name('subscribe')->alias('a')
			    ->join('goods_details b','a.goods_id=b.goods_id')
			    ->join('store c','a.subscribe_ctiy_name=c.store_name')
			    ->field('a.subscribe_time,a.goods_id,a.subscribe_ctiy_name,b.goods_pic,b.goods_name,b.goods_model,b.goods_describe,b.goods_car,b.goods_payment,b.goods_month')
			    // ->fetchSql(true)
			    ->where('a.user_phone',$user)
			    // ->where('c.store_name','a.subscribe_ctiy_name')
			    ->select();
			   

			    return $res;

		}
	}
	//提交预约
	public static function insertYuYue($data){
		$data['subscribe_time'] = strtotime($yuyueArr['subscribe_time'],time());
		$res = Db::name('subscribe')->insert($data);
		if($res){
			return $res;
		}
	}	

}